﻿@using Windvoice.Blog
@{
    ViewBag.Title = "Link Candidate";
    Layout = "~/Areas/Manage/Views/Shared/_Layout.cshtml";
}

@section headSection{
    <script type="text/javascript">
        $(function () {
            $('a[data-delete]').click(function () { $(this).handledelete('/manage/link/delete') });
        });
    </script>
}

<div class="pagetitle">
    <h2>待选链接管理</h2>
</div>

<ul class="link-list">
    @foreach (Link link in (Link[])ViewBag.LinkList)
    {
        <li>
            <div class="title">
                <div class="titlevalue"><a href="@link.LinkUrl" target="_blank">@link.Title</a></div>
                <div class="operate">
                    <a href="/manage/link/edit/@link.ID">编辑</a>
                    <a href="javascript:;" data-delete="@link.ID">删除</a>
                </div>
            </div>
            <div class="content">
                @if (link.Type == (int)LinkType.Image)
                {
                    <img src="@link.Title" alt="@link.Title" /> 
                }
                else
                {
                    @link.LinkUrl
                }                
            </div>
        </li> 
    }
    <div class="clear"></div>
</ul>